#include <cstdio>

int n, m, k, s, a[ 100 ], b[ 100 ], opt[ 100 ][ 100 ];

void init( )
{
    int i, j;
    for ( i = 0; i < k; i++ )
        scanf("%d%d", &a[ i ], &b[ i ]);
    for ( i = 0; i < s; i++ )
    {
        opt[ 0 ][ i ] = 0;
        for ( j = 1; j < n; j++ )
            opt[ j ][ i ] = -1;
    }
}

void work( )
{
    int i, j, p, min = 0xfffffff;
    for ( i = 0; i < k; i++ )
    {
        if ( a[ i ] >= n )
        {
            if ( min > b[ i ] )
                min = b[ i ];
        }
        else
            if ( opt[ a[ i ] ][ 0 ] == -1 || opt[ a[ i ] ][ 0 ] > b[ i ] )
                opt[ a[ i ] ][ 0 ] = b[ i ];
    }
    for ( p = 1; p < s; p++ )
    {
        for ( i = 0; i < k; i++ )
        {
            for ( j = n - 1; j >= a[ i ]; j-- )
            {
                if ( opt[ j - a[ i ] ][ p - 1 ] != -1 )
                    if ( ( opt[ j - a[ i ] ][ p - 1 ] + b[ i ] < opt[ j ][ p ] || opt[ j ][ p ] == -1 ) && opt[ j - a[ i ] ][ p - 1 ] + b[ i ] < m )
                        opt[ j ][ p ] = opt[ j - a[ i ] ][ p - 1 ] + b[ i ];
            }
            for ( j = n - a[ i ]; j < n; j++ )
            {
                if ( j < 0 )
                    continue;
                if ( opt[ j ][ p - 1 ] != -1 && min > opt[ j ][ p - 1 ] + b[ i ] )
                    min = opt[ j ][ p - 1 ] + b[ i ];
            }
        }
    }
    if ( m - min >= 0 )
        printf("%d\n", m - min);
    else
        puts("-1");
}

int main( )
{
    while ( scanf("%d%d%d%d", &n, &m, &k, &s) != EOF )
    {
        init( );
        work( );
    }
    return 0;
}
